import request from '@/utils/request'

// 查询兑换码列表
export function listCdkeys(query) {
  return request({
    url: '/ziliao/cdkeys/list',
    method: 'get',
    params: query
  })
}

// 查询兑换码全部列表
export function listCdkeysAll(query) {
  return request({
    url: '/ziliao/cdkeys/listCdkeysAll',
    method: 'get',
    params: query
  })
}

// 查询兑换码详细
export function getCdkeys(id) {
  return request({
    url: '/ziliao/cdkeys/' + id,
    method: 'get'
  })
}

// 新增兑换码
export function addCdkeys(data) {
  return request({
    url: '/ziliao/cdkeys',
    method: 'post',
    data: data
  })
}

export function genCdKey(data) {
  return request({
    url: '/ziliao/cdkeys/genCdKey',
    method: 'post',
    data: data
  })
}

// 修改兑换码
export function updateCdkeys(data) {
  return request({
    url: '/ziliao/cdkeys',
    method: 'put',
    data: data
  })
}

// 删除兑换码
export function delCdkeys(id) {
  return request({
    url: '/ziliao/cdkeys/' + id,
    method: 'delete'
  })
}
